package com.zzs.mall.component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author ZechariahZheng
 * @Date 2019/11/15 15:58
 * @Version 1.0
 * @description 订单超时取消并解锁库存的定时器
 */

@Component
public class OrderTimeOutCancelTask {
    private static final Logger LOGGER = LoggerFactory.getLogger(OrderTimeOutCancelTask.class);

    @Scheduled(cron = "0 0/10 * ? * ?")
    private void cancelTimeOutOrder() {
        //此处应该调用取消订单的方法
        LOGGER.info("取消订单，并根据sku编号释放锁定库存");
    }
}
